{include file="./headStart.tpl"}
{literal}
<script type="text/javascript">
$(document).ready(function(){  
    $("#userTypeFilter").change(function(){ 
    	var dataString = "userType=" + $(this).val();
    	  $.ajax({
       	  type: "GET",
          url:  "employeeAj.php",
          data: dataString,
          success: function(data){ 
          $("#technicianType").html(data);
        }
      });
   });
});
  
$(document).ready(function() {
// validate the contact form
  $("#frmUser").validate({
  	rules: {
  		firstName: { required: true, minlength: 2 },
  		mobile1: { required: true, minlength: 10, maxlength: 11 },
  		address: { required: true, minlength: 2 }
  	},
  	messages: {
  		firstName: "<img id='emailerror' src='./images/cross.png' height='10' width='10'/>",
  		mobile1: "<img id='emailerror' src='./images/cross.png' height='10' width='10'/>",
  		address: "<img id='emailerror' src='./images/cross.png' height='10' width='10'/>"
  	},
  	success:function(label){
  		label.html("<img src='./images/right.jpg' height='10' width='10' alt='Valid'>");
  	},
  });
});

function changeValue()
{
  var setValue = "";
  $("#image").hide();
  $("#imgFile").val(setValue);
}

function deletechecked()
{
	var answer = confirm("Delete Selected Recored ?")
	if (answer)
	{
	  document.messages.submit();
	}
	return false;
} 

function myFunction()
{
	if(confirm("Are You Sure To Delete")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

 
//<!!!------function userField()
{
//  if (document.frmUser.userType.value != "None") 
//  {
//    document.getElementById('userName').disabled = false;
//    document.getElementById('password').disabled = false;
//    document.getElementById("userName").focus();
//  }
//  else
//  {
//    document.getElementById('userName').disabled = true;
//    document.getElementById('password').disabled = true;
//    document.getElementById("userName").enabled = false;
//  }
//}
}
</script>
{/literal}
{include file="./headEnd.tpl"}
</head>
<form name="frmUser" action="{$smarty.server.PHP_SELF}" id="frmUser" method="post" enctype="multipart/form-data">
<input type="hidden" name="technicianId" value="{$technicianId}" />  
<input type="hidden" name="userId" value="{$userId}" />  
<table align="center" border="1" cellpadding="2" cellspacing="1" >
<tr>
  <td align="center" class="table1" colspan="4">User Entry</td>
</tr>
<tr>
  <td align="right" class="table2" colspan="2">User Type :</td>
  <td class="table2" align="left">
    <select name="userType" id="userType" selected />
      <option value="None">None</option>
      <option value="superAdmin">Super Admin</option>
      <option value="marketingManager">Marketing Manager</option>
      <option value="marketingExecutive">Marketing Executive</option>
      <option value="operationManager">Operation Manager</option>
      <option value="operationExecutive">Operation Executive</option>
    </select>
  </td>
</tr>
<tr>
  <td align="left" class="table2">User Name :</td>
  <td class="table2"><input type="text" name="userName" id="userName" value="{$editArray.userName}" ></td>
 <td class="table2" align="left">Password :</td>
  <td class="table2"><input type="text" name="password" id="password" value="{$editArray.password}" ></td>
</tr>
<tr>
  <td align="left" class="table2">First Name<font color="red"> *</font> :</td>
  <td class="table2"><input type="text" name="firstName" id="firstName" value="{$editArray.firstName}" title=" please enter First Name"></td>
  <td align="left" class="table2">Last Name :</td>
  <td class="table2"><input type="text" name="lastName" id="lastName" value="{$editArray.lastName}"></td>
</tr>
<tr>
  <td align="left" class="table2">Address<font color="red"> *</font> :</td>
  <td class="table2"><textarea  name="address" rows="3" cols="16">{$editArray.address}</textarea></td>
  <td align="left" class="table2">City :</td>
  <td class="table2"><input type="text" name="city" id="city" value="{$editArray.city}"></td>
</tr>
<tr>
  <td align="left" class="table2">Mobile1<font color="red"> *</font> :</td>
  <td class="table2"><input type="text" name="mobile1" id="mobile1" value="{$editArray.mobile1}"></td>
  <td align="left" class="table2">Mobile2 :</td>
  <td class="table2"><input type="text" name="mobile2" id="mobile2" value="{$editArray.mobile2}"></td>
</tr>
<tr>
  <td align="left" class="table2">Phone:</td>
  <td class="table2"><input type="text" name="phone" id="phone" value="{$editArray.phone}"></td>
  <td align="left" class="table2">Email :</td>
  <td class="table2"><input type="email" name="email" id="email" value="{$editArray.email}"></td>
</tr>
<tr>
	<td align="left" class="table2">Image:</td>
	<td class="table2">{if $editArray.image != ""}<div id="image">{$editArray.image}<img src="./images/deleteIcon.png" height="15" width="15" onclick="changeValue()" /></div>{/if}</td>
	<input type="hidden" name="imgFile" id="imgFile" value="{$editArray.image}">
	<td class="table2" colspan="2"><input type="file" name="file" id="file" /></td>
</tr>
<tr>
  <td class="table2" align="right" colspan="2"><input class="button" type="submit" name="insertBtn" value="Submit" class="insertBtn" /></td>
  <td class="table2" colspan="3">
  {if $technicianId > 0}
  <input class="button" type="submit" name="cancelBtn" value="Cancel" />
  {else}
  &nbsp
  {/if}
  </td>
</tr>
<tr>
</tr>
</table>
</form>
<table align="center">
<tr>
  <td>
    <select name="userTypeFilter" id="userTypeFilter">
    <option value="0">All</option>
      {html_options values=$techArray.userType output=$techArray.userType selected=$technicianSelected}
    </select>
  </td>
</tr>
</table>
<div id="technicianType">
<table border='0' cellpadding='1' cellspacing='2' align='center'>
<tr>
  <td class="table1" align="center" colspan="13"><font style="font-size: 16px"><b> Employee Available </b></font></td>
</tr>
<tr>
  <td  class="table1" align='center'><B>&nbsp;</td>
  <td  class="table1" align='center'><B>&nbsp;</td>
	<td  class="table1" align='center' ><B>S.R.No</td>
	<td  class="table1" align='center' ><B>User Type</td>
	<td  class="table1" align='center' ><B>User Name</td>
	<td  class="table1" align='center' ><B>Employee Name</td>
	<td  class="table1" align='center' ><B>Address</td>
	<td  class="table1" align='center' ><B>City</td>
	<td  class="table1" align='center' ><B>Mobile1</td>
	<td  class="table1" align='center' ><B>Mobile2</td>
	<td  class="table1" align='center' ><B>Phone</td>
	<td  class="table1" align='center' ><B>Email</td>
	<td  class="table1" align='center' ><B>image</td>
</tr>
  {section name="sec1" loop=$technicianIdDetailArray}
<tr>
  <td class="table3" align="center">
    <a href="employee.php?technicianId={$technicianIdDetailArray[sec1].technicianId}" class="link"><img src="./images/b_edit.png" border="0" width="15" height="15"></a>
  </td>
  <td class="table3" align="center">
	  <a href="employeeDelete.php?technicianId={$technicianIdDetailArray[sec1].technicianId}" onclick="return myFunction();" class="link"><img src="./images/deleteIcon.png" border="0" width="15" height="15"></a>
  </td>
  <td class="table3" align="left">{$smarty.section.sec1.rownum}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].userType}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].userName}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].technicianName}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].address}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].city}</td>
  <td class="table3" align="right">{$technicianIdDetailArray[sec1].mobile1}</td>
  <td class="table3" align="right">{$technicianIdDetailArray[sec1].mobile2}</td>
  <td class="table3" align="right">{$technicianIdDetailArray[sec1].phone}</td>
  <td class="table3" align="left">{$technicianIdDetailArray[sec1].email}</td>
  {if $technicianIdDetailArray[sec1].image == ""}
  <td class="table3" align="left">&nbsp;</td>
  {else}
  <td class="table3" align="left"  id="imgtooltip">
  	<span><img src="./upload/{$technicianIdDetailArray[sec1].image}" height="150" width="150"></span>
  	<img src="./upload/{$technicianIdDetailArray[sec1].image}" height="20" width="20">
  </td>
  {/if}
</tr>
{/section}
</table>
</div>
{include file="footer.tpl"}